<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>心之所向：我们的爱情故事</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&display=swap"
          rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
</head>
<body>
<div class="preloader">
    <div class="loader"></div>
</div>

<div class="cursor"></div>
<div class="cursor-dot"></div>

<header>
    <nav>
        <a href="#" class="logo">心之所向</a>
        <div class="menu-toggle">
            <span></span>
            <span></span>
            <span></span>
        </div>
        <ul class="nav-links">
            <li><a href="#home">首页</a></li>
            <li><a href="#story">我们的故事</a></li>
            <li><a href="#gallery">珍贵回忆</a></li>
            <li><a href="#video">浪漫时刻</a></li>
            <li><a href="#timeline">时光轴</a></li>
            <li><a href="#letter">真挚告白</a></li>
        </ul>
    </nav>
</header>

<main>
    <section id="home" class="hero">
        <div class="hero-content">
            <h1>心之所向，情之所归</h1>
            <p>在这浩瀚宇宙中，能与你相遇，是我生命中最璀璨的星河</p>
            <a href="#story" class="btn">开启我们的故事</a>
        </div>
    </section>

    <section id="story" class="story-section">
        <div class="container">
            <h2>我们的故事</h2>
            <div class="story-grid">
                <article class="story-card">
                    <div class="story-image">
                        <img src="static/1 (2).png" alt="初次相遇">
                    </div>
                    <div class="story-content">
                        <h3>初次相遇</h3>
                        <p>那天，阳光温柔，你的笑容如春风拂面，瞬间点亮了我的世界。</p>
                    </div>
                </article>
                <article class="story-card">
                    <div class="story-image">
                        <img src="static/1 (3).png" alt="甜蜜时光">
                    </div>
                    <div class="story-content">
                        <h3>甜蜜时光</h3>
                        <p>每一个与你共度的瞬间，都是上天赐予的珍贵礼物。</p>
                    </div>
                </article>
                <article class="story-card">
                    <div class="story-image">
                        <img src="static/1 (4).png" alt="浪漫旅行">
                    </div>
                    <div class="story-content">
                        <h3>浪漫旅行</h3>
                        <p>在陌生的城市，我们携手探索，你是我最美的风景。</p>
                    </div>
                </article>
            </div>
        </div>
    </section>

    <section id="gallery" class="gallery-section">
        <div class="container">
            <h2>珍贵回忆</h2>
            <div class="gallery-grid">
                <div class="gallery-item"><img src="static/1 (5).png" alt="幸福时刻"><span>幸福时刻</span></div>
                <div class="gallery-item"><img src="static/1 (6).png" alt="甜蜜约会"><span>甜蜜约会</span></div>
                <div class="gallery-item"><img src="static/1 (7).png" alt="浪漫晚餐"><span>浪漫晚餐</span></div>
                <div class="gallery-item"><img src="static/1 (8).png" alt="美好回忆"><span>美好回忆</span></div>
                <div class="gallery-item"><img src="static/1 (9).png" alt="幸福瞬间"><span>幸福瞬间</span></div>
                <div class="gallery-item"><img src="static/1 (10).png" alt="温馨时光"><span>温馨时光</span></div>
            </div>
        </div>
    </section>

    <section id="video" class="video-section">
        <div class="container">
            <h2>浪漫时刻</h2>
            <div class="video-wrapper">
                <video controls playsinline>
                    <source src="static/1.mp4" type="video/mp4">
                </video>
            </div>
        </div>
    </section>

    <section id="timeline" class="timeline-section">
        <div class="container">
            <h2>我们的时光轴</h2>
            <div class="timeline">
                <div class="timeline-item">
                    <div class="timeline-content">
                        <time>2022.04</time>
                        <h3>初次相遇</h3>
                        <p>那天，我们的目光在图书馆相遇，世界仿佛停止了转动。</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-content">
                        <time>2022.06</time>
                        <h3>甜蜜告白</h3>
                        <p>在樱花盛开的季节，我鼓起勇气向你表白，你的笑容是最美的回应。</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-content">
                        <time>2022.08</time>
                        <h3>浪漫旅行</h3>
                        <p>我们的第一次旅行，在异国他乡感受爱情的美好。</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-content">
                        <time>2023.02</time>
                        <h3>共度难关</h3>
                        <p>在人生的低谷，我们携手共渡难关，爱情更加坚固。</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-content">
                        <time>2023.10</time>
                        <h3>美好未来</h3>
                        <p>展望未来，我们憧憬着美好的生活，期待每一个共度的日子。</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section id="letter" class="letter-section">
        <div class="container">
            <h2>真挚告白</h2>
            <div class="letter">
                <p>亲爱的，</p>
                <p>当我执笔写下这封信时，内心充满了激动和温暖。回首往事，与你相遇的每一个瞬间都历历在目，仿佛发生在昨日。</p>
                <p>
                    还记得我们初次相遇的那个午后吗？阳光温柔地洒在图书馆的书架上，你专注阅读的侧颜让我难以移开视线。那一刻，我就知道，你是我一直在等待的那个人。</p>
                <p>感谢你出现在我的生命中，让我的世界变得如此美好。我爱你，现在和永远。</p>
                <p class="signature">永远爱你的我</p>
            </div>
        </div>
    </section>
</main>

<footer>
    <div class="container">
        <div class="footer-content">
            <h3>永远爱你</h3>
            <p>无论晴天雨天，我都愿意与你一同前行</p>
            <div class="social-links">
                <a href="#"><i class="fab fa-weixin"></i></a>
                <a href="#"><i class="fab fa-weibo"></i></a>
                <a href="#"><i class="fab fa-instagram"></i></a>
                <a href="#"><i class="fab fa-twitter"></i></a>
            </div>
        </div>
    </div>
</footer>

<div class="lightbox">
    <button class="lightbox-close">&times;</button>
    <img src="" alt="">
</div>

<div class="music-player">
    <button class="play-pause"><i class="fas fa-play"></i></button>
    <span>正在播放：我们的爱情协奏曲</span>
</div>

<div class="hearts-container"></div>
</body>
</html>

<style>
    :root {
        --color-primary: #e74c3c;
        --color-secondary: #3498db;
        --color-accent: #f1c40f;
        --color-text: #2c3e50;
        --color-bg: #ecf0f1;
        --color-white: #ffffff;
        --color-black: #000000;
        --transition: all 0.3s ease;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        --radius: 10px;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    html {
        scroll-behavior: smooth;
        font-size: 16px;
    }

    body {
        font-family: 'Noto Serif SC', serif;
        line-height: 1.8;
        color: var(--color-text);
        background-color: var(--color-bg);
        overflow-x: hidden;
    }

    .container {
        width: min(1200px, 90%);
        margin: 0 auto;
    }

    header {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        z-index: 1000;
        backdrop-filter: blur(10px);
        transition: var(--transition);
    }

    header.scrolled {
        background: rgba(255, 255, 255, 0.95);
        box-shadow: var(--shadow);
    }

    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 5%;
        max-width: 1400px;
        margin: 0 auto;
    }

    .logo {
        font-family: 'Ma Shan Zheng', cursive;
        font-size: 2rem;
        color: var(--color-primary);
        text-decoration: none;
        transition: var(--transition);
    }

    .nav-links {
        display: flex;
        gap: 2rem;
        list-style: none;
    }

    .nav-links a {
        text-decoration: none;
        color: var(--color-text);
        font-weight: 500;
        transition: var(--transition);
        position: relative;
    }

    .nav-links a::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--color-primary);
        transition: var(--transition);
    }

    .nav-links a:hover::after {
        width: 100%;
    }

    .menu-toggle {
        display: none;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
    }

    .menu-toggle span {
        width: 30px;
        height: 3px;
        background: var(--color-text);
        transition: var(--transition);
    }

    .hero {
        height: 100vh;
        display: grid;
        place-items: center;
        background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url('static/1 (1).png') center/cover;
        color: var(--color-white);
        text-align: center;
    }

    .hero-content {
        max-width: 800px;
        padding: 2rem;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 5vw, 4rem);
        margin-bottom: 1rem;
        font-family: 'ZCOOL XiaoWei', serif;
    }

    .hero p {
        font-size: clamp(1rem, 2vw, 1.2rem);
        margin-bottom: 2rem;
        opacity: 0.9;
    }

    .btn {
        display: inline-block;
        padding: 1rem 2rem;
        background: var(--color-primary);
        color: var(--color-white);
        text-decoration: none;
        border-radius: 50px;
        transition: var(--transition);
        position: relative;
        overflow: hidden;
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .story-section {
        padding: 5rem 0;
        background: var(--color-white);
    }

    .story-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        padding: 2rem 0;
    }

    .story-card {
        background: var(--color-white);
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: var(--shadow);
        transition: var(--transition);
        transform-style: preserve-3d;
    }

    .story-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .story-image {
        width: 100%;
        height: 200px;
        overflow: hidden;
    }

    .story-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: var(--transition);
    }

    .story-card:hover .story-image img {
        transform: scale(1.1);
    }

    .story-content {
        padding: 1.5rem;
    }

    .story-content h3 {
        color: var(--color-primary);
        margin-bottom: 0.5rem;
    }

    .gallery-section {
        padding: 5rem 0;
        background: var(--color-bg);
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        padding: 2rem 0;
    }

    .gallery-item {
        position: relative;
        border-radius: var(--radius);
        overflow: hidden;
        aspect-ratio: 1;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: var(--transition);
    }

    .gallery-item span {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
        color: var(--color-white);
        transform: translateY(100%);
        transition: var(--transition);
    }

    .gallery-item:hover span {
        transform: translateY(0);
    }

    .gallery-item:hover img {
        transform: scale(1.1);
    }

    .video-section {
        padding: 5rem 0;
        background: var(--color-white);
    }

    .video-wrapper {
        position: relative;
        width: 100%;
        padding-top: 56.25%;
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: var(--shadow);
    }

    .video-wrapper video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .timeline-section {
        padding: 5rem 0;
        background: var(--color-bg);
    }

    .timeline {
        position: relative;
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem 0;
    }

    .timeline::before {
        content: '';
        position: absolute;
        width: 2px;
        background: var(--color-primary);
        top: 0;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        margin-bottom: 2rem;
        position: relative;
        width: 50%;
    }

    .timeline-item:nth-child(odd) {
        left: 0;
        padding-right: 2rem;
    }

    .timeline-item:nth-child(even) {
        left: 50%;
        padding-left: 2rem;
    }

    .timeline-content {
        background: var(--color-white);
        padding: 1.5rem;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .timeline-content time {
        display: block;
        color: var(--color-primary);
        margin-bottom: 0.5rem;
    }

    .letter-section {
        padding: 5rem 0;
        background: var(--color-white);
    }

    .letter {
        max-width: 800px;
        margin: 0 auto;
        background: var(--color-white);
        padding: 2rem;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .letter p {
        margin-bottom: 1rem;
    }

    .signature {
        text-align: right;
        font-style: italic;
        color: var(--color-primary);
    }

    footer {
        background: var(--color-text);
        color: var(--color-white);
        padding: 3rem 0;
        text-align: center;
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .social-links a {
        color: var(--color-white);
        font-size: 1.5rem;
        transition: var(--transition);
    }

    .social-links a:hover {
        color: var(--color-primary);
        transform: translateY(-3px);
    }

    .lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2000;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .lightbox.active {
        opacity: 1;
        pointer-events: auto;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 90vh;
    }

    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        color: var(--color-white);
        font-size: 2rem;
        cursor: pointer;
    }

    .music-player {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.9);
        padding: 0.5rem 1rem;
        border-radius: 50px;
        display: flex;
        align-items: center;
        gap: 1rem;
        box-shadow: var(--shadow);
        z-index: 100;
    }

    .play-pause {
        background: none;
        border: none;
        color: var(--color-primary);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .cursor {
        width: 20px;
        height: 20px;
        border: 2px solid var(--color-primary);
        border-radius: 50%;
        position: fixed;
        pointer-events: none;
        z-index: 9999;
        transition: 0.1s ease;
        transform: translate(-50%, -50%);
    }

    .cursor-dot {
        width: 5px;
        height: 5px;
        background: var(--color-primary);
        border-radius: 50%;
        position: fixed;
        pointer-events: none;
        z-index: 9999;
        transition: 0.15s ease-out;
        transform: translate(-50%, -50%);
    }

    .hearts-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    }

    .heart {
        position: absolute;
        font-size: 1.5rem;
        color: var(--color-primary);
        animation: fall 3s linear forwards;
    }

    @keyframes fall {
        to {
            transform: translateY(105vh) rotate(360deg);
        }
    }

    .preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--color-white);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        transition: 0.5s ease;
    }

    .preloader.fade-out {
        opacity: 0;
    }

    .loader {
        width: 50px;
        height: 50px;
        border: 5px solid var(--color-bg);
        border-top-color: var(--color-primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    @media (max-width: 768px) {
        .menu-toggle {
            display: flex;
        }

        .nav-links {
            position: fixed;
            top: 70px;
            left: 0;
            right: 0;
            background: var(--color-white);
            flex-direction: column;
            align-items: center;
            padding: 2rem;
            clip-path: circle(0% at top right);
            transition: var(--transition);
        }

        .nav-links.active {
            clip-path: circle(150% at top right);
        }

        .timeline::before {
            left: 30px;
        }

        .timeline-item {
            width: 100%;
            padding-left: 70px;
        }

        .timeline-item:nth-child(even) {
            left: 0;
            padding-left: 70px;
        }
    }
</style>

<script>
    document.addEventListener('DOMContentLoaded', () => {
        const audioElement = new Audio('static/bgm.mp3');
        audioElement.loop = true;

        const init = () => {
            setupHeader();
            setupMenu();
            setupGallery();
            setupVideo();
            setupParallax();
            setupCursor();
            setupHearts();
            setupMusic();
            setupPreloader();
            setupScrollReveal();
            setupTypingEffect();
        };

        const setupHeader = () => {
            const header = document.querySelector('header');
            window.addEventListener('scroll', () => {
                header.classList.toggle('scrolled', window.scrollY > 50);
            });
        };

        const setupMenu = () => {
            const menuToggle = document.querySelector('.menu-toggle');
            const navLinks = document.querySelector('.nav-links');

            menuToggle.addEventListener('click', () => {
                navLinks.classList.toggle('active');
                const spans = menuToggle.querySelectorAll('span');
                spans[0].style.transform = navLinks.classList.contains('active') ? 'rotate(45deg) translate(8px, 8px)' : '';
                spans[1].style.opacity = navLinks.classList.contains('active') ? '0' : '1';
                spans[2].style.transform = navLinks.classList.contains('active') ? 'rotate(-45deg) translate(7px, -7px)' : '';
            });

            document.querySelectorAll('.nav-links a').forEach(link => {
                link.addEventListener('click', (e) => {
                    e.preventDefault();
                    const targetId = link.getAttribute('href');
                    const targetSection = document.querySelector(targetId);
                    navLinks.classList.remove('active');

                    window.scrollTo({
                        top: targetSection.offsetTop - 70,
                        behavior: 'smooth'
                    });
                });
            });
        };

        const setupGallery = () => {
            const lightbox = document.querySelector('.lightbox');
            const lightboxImg = lightbox.querySelector('img');
            const closeBtn = lightbox.querySelector('.lightbox-close');

            document.querySelectorAll('.gallery-item').forEach(item => {
                item.addEventListener('click', () => {
                    const imgSrc = item.querySelector('img').src;
                    lightboxImg.src = imgSrc;
                    lightbox.classList.add('active');
                });
            });

            closeBtn.addEventListener('click', () => {
                lightbox.classList.remove('active');
            });

            lightbox.addEventListener('click', (e) => {
                if (e.target === lightbox) {
                    lightbox.classList.remove('active');
                }
            });
        };

        const setupVideo = () => {
            const video = document.querySelector('.video-wrapper video');
            const videoObserver = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (!entry.isIntersecting) {
                        video.pause();
                    }
                });
            }, {threshold: 0.5});
            videoObserver.observe(video);
        };

        const setupParallax = () => {
            const hero = document.querySelector('.hero');
            window.addEventListener('scroll', () => {
                const scrolled = window.pageYOffset;
                hero.style.backgroundPositionY = `${scrolled * 0.5}px`;
            });
        };

        const setupCursor = () => {
            const cursor = document.querySelector('.cursor');
            const cursorDot = document.querySelector('.cursor-dot');

            document.addEventListener('mousemove', (e) => {
                cursor.style.left = e.clientX + 'px';
                cursor.style.top = e.clientY + 'px';
                cursorDot.style.left = e.clientX + 'px';
                cursorDot.style.top = e.clientY + 'px';
            });

            document.addEventListener('mousedown', () => {
                cursor.style.transform = 'translate(-50%, -50%) scale(0.8)';
                cursorDot.style.transform = 'translate(-50%, -50%) scale(0.5)';
            });

            document.addEventListener('mouseup', () => {
                cursor.style.transform = 'translate(-50%, -50%) scale(1)';
                cursorDot.style.transform = 'translate(-50%, -50%) scale(1)';
            });

            document.querySelectorAll('a, button').forEach(el => {
                el.addEventListener('mouseenter', () => {
                    cursor.style.transform = 'translate(-50%, -50%) scale(1.5)';
                    cursorDot.style.transform = 'translate(-50%, -50%) scale(0)';
                });

                el.addEventListener('mouseleave', () => {
                    cursor.style.transform = 'translate(-50%, -50%) scale(1)';
                    cursorDot.style.transform = 'translate(-50%, -50%) scale(1)';
                });
            });
        };

        const setupHearts = () => {
            const container = document.querySelector('.hearts-container');

            const createHeart = () => {
                const heart = document.createElement('div');
                heart.classList.add('heart');
                heart.style.left = Math.random() * 100 + 'vw';
                heart.style.animationDuration = Math.random() * 2 + 3 + 's';
                heart.innerHTML = '♥';
                container.appendChild(heart);

                setTimeout(() => heart.remove(), 5000);
            };

            setInterval(createHeart, 300);
        };

        const setupMusic = () => {
            const playPauseBtn = document.querySelector('.play-pause');
            let isPlaying = false;

            playPauseBtn.addEventListener('click', () => {
                if (isPlaying) {
                    audioElement.pause();
                    playPauseBtn.innerHTML = '<i class="fas fa-play"></i>';
                } else {
                    audioElement.play();
                    playPauseBtn.innerHTML = '<i class="fas fa-pause"></i>';
                }
                isPlaying = !isPlaying;
            });
        };

        const setupPreloader = () => {
            const preloader = document.querySelector('.preloader');
            window.addEventListener('load', () => {
                preloader.classList.add('fade-out');
                setTimeout(() => {
                    preloader.style.display = 'none';
                }, 500);
            });
        };

        const setupScrollReveal = () => {
            const callback = (entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('active');
                    }
                });
            };

            const observer = new IntersectionObserver(callback, {
                threshold: 0.1
            });

            document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
        };

        const setupTypingEffect = () => {
            const text = document.querySelector('.hero h1').textContent;
            const heroTitle = document.querySelector('.hero h1');
            heroTitle.textContent = '';

            let i = 0;
            const type = () => {
                if (i < text.length) {
                    heroTitle.textContent += text.charAt(i);
                    i++;
                    setTimeout(type, 100);
                }
            };

            setTimeout(type, 1000);
        };

        init();
    });

    document.addEventListener('touchstart', () => {
        const audioContext = new (window.AudioContext || window.webkitAudioContext)();
        if (audioContext.state === 'suspended') {
            audioContext.resume();
        }
    });
</script>